package com.lancoo.ccas52.pojo.response.score;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.lancoo.ccas52.entity.StudentRetake;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName Retake
 * @Description 重修学生 免修学生
 * @Author quin
 * @Date 2023/4/10 9:17
 */
@NoArgsConstructor
@Data
public class Retake {
    @JsonProperty("SchemeID")
    private String schemeID;
    @JsonProperty("CourseNumber")
    private String courseNumber;
    @JsonProperty("CourseNO")
    private String courseNO;
    @JsonProperty("StudentID")
    private String studentID;
    @JsonProperty("CourseSort")
    private Integer courseSort;
    @JsonProperty("CourseSortN")
    private String courseSortN;

    /**1主修  2辅修 3双学位  4方案外*/
    @JsonProperty("SchemeType")
    private Integer schemeType;
    @JsonProperty("SchemeTypeN")
    private String schemeTypeN;

    public StudentRetake toEntity(Integer taskId,String schoolId, String term) {
        return new StudentRetake()
                .setTaskId(taskId)
                .setSchoolId(schoolId)
                .setTerm(term)
                .setBaseCourseId(courseNO)
                .setBaseStudentId(studentID)
                .setBaseTeachingPlanId(schemeID)
                .setFlag(courseSort == 0 ? 1 : 2)
                .setStudyNature(schemeType == 1 ? 1 : (schemeType == 3 ? 2 : schemeType))
                .setIsAllocation(0);
    }
}
